Skip to content

Add output "ticketNumber" #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

koppor
Copy link

@koppor koppor commented Mar 11, 2025

Note: I needed to add build/index.js to be able to test.

Summary

Fixes #57

Now the action can be used to output the determined ticket number. One can also configure outputOnly to use only the determination of the ticket number.

Example use:

      - name: Determine issue number
        id: get_issue_number
        uses: koppor/ticket-check-action@add-output
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          ticketLink: 'https://github.com/:owner/:repo/issues/%ticketNumber%'
          ticketPrefix: '#'
          titleRegex: '^#(?<ticketNumber>\d+)'
          branchRegex: '^(?<ticketNumber>\d+)'
          bodyRegex: '#(?<ticketNumber>\d+)'
          bodyURLRegex: 'http(s?):\/\/(github.com)(\/:owner)(\/:repo)(\/issues)\/(?<ticketNumber>\d+)'
          outputOnly: true
      - name: Move issue to "Backlog"
        uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
        with:
          github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
          project-url: "https://github.com/users/koppor/projects/7"
          target-labels: "📍 Assigned"
          target-column: "Backlog"
          ignored-columns: ""
          default-column: "Backlog"
          issue-number: ${{ steps.get_issue_number.outputs.ticketNumber }}
          skip-if-not-in-project: true

Updated dependencies

none

Future work

none

Checklist

  • Have you fully tested your PR locally?
  • Have you written thorough tests for your work?
  • Have you made a CHANGELOG entry?

@koppor
Copy link
Author

koppor commented Mar 19, 2025

@neofinancial I successfully used this variant of the action for dozens of PRs. Could you consider reviewing it and merging?

@koppor
Copy link
Author

koppor commented Apr 18, 2025

Can't get it to work to output "-1" in the case of no ticket number; currently only "" is output in case no regex matches. --> JabRef/jabref#12951 (comment)

Update Used wrong variable name: JabRef/jabref@e724f88 (#12951)

@koppor
Copy link
Author

koppor commented Apr 18, 2025

With an issue number, it works now

Next step: check for workflows without an issue number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output ticket number
1 participant